home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
os2
/
nlsnps.zip
/
nlsCompare.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1996-09-03
|
476b
|
22 lines
#define INCL_DOSNLS
#include <os2.h>
#include "nls.h"
int nlsCompare(PUCHAR psz1, PUCHAR psz2)
{ while (1)
{ UCHAR uc1 = *psz1++, uc2 = *psz2++;
if (uc1 != uc2)
{ int iDiff = (UINT)nlsCollate(uc1) - (UINT)nlsCollate(uc2);
if (iDiff != 0) return iDiff;
}
else
{ if (uc1 == 0) return 0;
else if (nlsIsDBCS(uc1))
{ int iDiff = (UINT)*psz1++ - (UINT)*psz2++;
if (iDiff != 0) return iDiff;
}
}
}
}